<?php

class Welcome extends Controller {
	
	function Welcome() {
		parent::Controller ();
	}
	
	function index() {
		redirect( 'user/userAction/login');
	}
	
	function init() {
		$this->load->helper ( 'edit' );
		$data ['user'] = array ('id' => '1', 'name' => 'tom' );
		$this->load->view ( 'test', $data );
	}
	function test($offset=0, $msg='') {
		echo $offset;
		echo "<hr />";
		echo $msg;
	}
	function edit() {
		$data ['user'] = array ('username' => 'tom', 'dd' => '2', 'password' => '123', 'email' => "x@s.com" );
		$this->load->helper ( array ('form' ) );
		$this->load->library ( 'form_validation' );
		$this->form_validation->set_rules ( 'username', 'Username', 'required' );
		$this->form_validation->set_rules ( 'password', 'Password', 'required' );
		$this->form_validation->set_rules ( 'passconf', 'Password Confirmation', 'required' );
		$this->form_validation->set_rules ( 'email', 'Email', 'required' );
		if ($this->form_validation->run () == FALSE) {
			$this->load->view ( 'test', $data );
		} else {
			echo "ok";
			//$this->load->view ( 'test' );
		}
	}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */